<template>
  <div id="signlist"> 

          <el-table :data="datalist" style="width: 100%" :height="dtheight" :header-cell-style="{background:'#4F81BC',color:'white'}"
           :row-class-name="tableRowClassName"  :border="true">

                <el-table-column label="星期"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.week }}</span>
                    </template>
                </el-table-column>   
                <el-table-column :label="'奖励' + '(' + variable_name2 + ')'"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.gdb }}</span>
                    </template>
                </el-table-column>

                 <el-table-column label="操作" align='center' width="300px">
                    <template slot-scope="scope"> 
                        <el-button size="mini"  type="primary"  plain @click="xg_but(scope.row)">修改</el-button> 
                    </template>
                </el-table-column>        

  
            </el-table>  


            
      <!-- 修改数量 -->
    <el-dialog title="修改数量" :visible.sync="xg_mtk"  width="400px">
        <div style="width:100%;"> 


        <el-form ref="form"   label-width="50px" style="width:100%;">
    
             <el-form-item label="数量">
                    <el-input    v-model="mtk_form.number" placeholder="请输入数量"></el-input>
              </el-form-item> 

            <div style="text-align: center;width:50%;margin:auto;">
                <el-button type="primary" class="custom_color_button" style="width:80%;" @click="xg_but_qr">确认</el-button>
            </div>
         </el-form>
        </div> 
    </el-dialog>



   



   </div>
</template>

<script>

export default {
   name: 'signlist',
   props:{
      datalist:{  
        //type:Array,
       default:()=>[]
     },
  },
  data () {
    return {
        dtheight:'500',  //窗口高度
        mtk_form:{
             number:'',
        },
        xg_mtk:false,
        my_id:'',
    }
  },
   components:{

  },
  created(){
     this.dtheight = window.innerHeight - 200
      
  },
  mounted (){
    
  },
  methods: {
    xg_but(row){
        this.my_id = row.id
        this.mtk_form.number = row.gdb
        this.xg_mtk = true
    },
    xg_but_qr(){
       this.post("/sign_reward/update", {
                   id:this.my_id,
                   gdb:this.mtk_form.number,
                }).then(res => {

                    if(res.error_code == 0){
                        this.open1(res.result,'success')  //提示框
                        this.$emit('up_list_fun')
                        this.xg_mtk = false

                    }else {
                     this.open1(res.message,'warning')
                    }

              })
    },

  }
}
</script>


<style scoped>

</style>